home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gigarom 1
/
Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso
/
FILES
/
QUI
/
UTI
/
Premier Plug-In Kit 1.0.cpt
/
Premier Plug-In Kit 1.0
/
MPW Examples
/
.c
/
Backwards [Audio].c
next >
Wrap
Text File
|
1992-03-04
|
1KB
|
41 lines
//———————————————————————————————————————————————
//
// ©1991 Adobe Systems Inc.
// written by Randy Ubillos
//
//———————————————————————————————————————————————
// Load in your Mac headers here
#pragma load "headers.d"
#include "Interface-Filter.h"
//———————————————————————————————————————————————
// Perform the effect
pascal short xFilter(short selector, AudioFilter theData)
{
short result = 0;
unsigned char *dest,*buff;
long count,i,sample;
switch (selector) {
case fsExecute:
dest = (*theData)->destination; // destination buffer
count = (*theData)->samplecount;
sample = (*theData)->totalsamples - count - (*theData)->samplenum; // calculate new sample
if ((*theData)->callBack) { // can we call back?
if (buff = NewPtr(count)) { // we need a buffer
if (!((*theData)->callBack)(sample,count,buff,(*theData)->privateData)) { // get the data
for (i=0; i<count; i++) dest[i] = buff[count-i-1]; // flip it around
}
DisposPtr(buff); // kill the buffer
}
}
else BlockMove((*theData)->source,dest,count); // otherwise, just copy
break;
}
return(result);
}